﻿Imports System.Activities
Imports System.Activities.Presentation
Imports System.Drawing
Imports System.Windows.Media
Imports System.Windows
Imports System.Windows.Media.Imaging

Public MustInherit Class DesignerBase
    Inherits ActivityDesigner

    Protected Property IconFileName As String = ""

    Protected Sub SetResourceIcon()
        Try
            Dim resStream = Me.GetType.Module.Assembly.GetManifestResourceStream(
                                         Me.GetType, Me.IconFileName)
            Dim resFrame = BitmapFrame.Create(resStream)

            Me.Icon = New DrawingBrush With {
                .Drawing = New ImageDrawing With {
                    .Rect = New Rect(0, 0, 16, 16),
                    .ImageSource = resFrame
                }
            }
        Catch ex As Exception

        End Try
    End Sub

End Class
